import {post,get} from '@/utils/http'
const baseUrl = 'http://localhost:6012/product-client/cms'

export function queryPageList(params) {

  return post(`${baseUrl}/supplierInfo/queryPageList`, params,{
    headers:{
      'Content-Type':'application/json'
    },
    noToken:true
  })
}
export function queryProductTypeList(params) {

  return post(`${baseUrl}/productCategory/queryPageList`, params,{
    headers:{
      'Content-Type':'application/json'
    },
    noToken:true
  })
}
export function selectAll() {

  return post(`${baseUrl}/productCategory/selectAll`, {},{
    headers:{
      'Content-Type':'application/json'
    }
  })
}
export function insertSupplier(params) {

  return post(`${baseUrl}/supplierInfo/insert`, params,{
    headers:{
      'Content-Type':'application/json'
    },
    noToken:true
  })
}
export function updateSupplier(params) {

  return post(`${baseUrl}/supplierInfo/update`, params,{
    headers:{
      'Content-Type':'application/json'
    },
    noToken:true
  })
}
export function deleteSupplier(id) {

  return post(`${baseUrl}/supplierInfo/delete`, {},{
    params:{id},
    noToken:true
  })
}
export function updateProductType(params) {

  return post(`${baseUrl}/productCategory/update`, params,{
    headers:{
      'Content-Type':'application/json'
    },
    noToken:true
  })
}
export function insertProductType(params) {

  return post(`${baseUrl}/productCategory/insert`, params,{
    headers:{
      'Content-Type':'application/json'
    },
    noToken:true
  })
}
export function deleteProductType(id) {

  return post(`${baseUrl}/productCategory/delete`,{}, {
    params:{ id : id },
    noToken:true

  })
}
export function deleteProduct(id) {

  return post('http://localhost:6013/order-client/cms/productInfo/delete',{}, {
    params:{ id : id },
    noToken:true

  })
}
export function detailProductList() {

  const backendUrl = 'http://localhost:6013/order-client/cms/productInfo/detailedList';
  return get(backendUrl); // 调用 get 方法发起后端请求
}
export function updateProductInfo(params){
  return post('http://localhost:6013/order-client/cms/productInfo/update',params,{
    noToken:true
  })
}
export function queryProductList(params) {

  return post('http://localhost:6013/order-client/api/productInfo/queryPageList', params,{
    headers:{
      'Content-Type':'application/json'
    },
    noToken:true
  })
}
export function insertProduct(params) {

  return post('http://localhost:6013/order-client/cms/productInfo/insert', params,{
    headers:{
      'Content-Type':'application/json'
    },
    noToken:true
  })
}

export function activeList(){
  return get('http://localhost:6012/product-client/cms/supplierInfo/activeList',{},{
     noToken:true
  })
}
export function activeCategoryList(){
  return get('http://localhost:6012/product-client/cms/productCategory/activeList',{},{
     noToken: true
 })
}
